#ifndef __TCPSERVER_H_
#define __TCPSERVER_H_
#include"Acceptor.h"
#include"EventLoop.h"
#include<string>

using std::string;

namespace SC
{
    class TcpServer : Noncopyable
    {
    public:
        TcpServer(const string& ip, unsigned short port);

        void start();
        void stop();
    
        void setConnectionCB(const TcpConnectionCallBack&);
        void setMessageCB(const TcpConnectionCallBack&);
        void setCloseCB(const TcpConnectionCallBack&);

    private:
        Acceptor _acceptor;
        EventLoop _loop;
    };
}
#endif